/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session;


import ejb.Outfit;
import ejb.OutfitFacadeLocal;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Gemma
 */
@Stateless
public class GestOutfit implements GestOutfitLocal {
    @PersistenceContext(unitName = "WhatToWear-ejbPU")
    private EntityManager em;
    @EJB
    private OutfitFacadeLocal outfitFacade;
   
    
    @Override
        public void addOutfit(String idUtente, String outfit, char[] outfitbase64) {
        Outfit of = new Outfit();
        of.setIdUtente(idUtente);
        of.setOutfit(outfit);
        of.setOutfitbase64(outfitbase64);
 
        outfitFacade.create(of);
    
        }
    

    // Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Business Method")

public void create(Outfit outfit) {
        outfitFacade.create(outfit);
    }

    public void edit(Outfit outfit) {
        outfitFacade.edit(outfit);
    }

    public void remove(Outfit outfit) {
        outfitFacade.remove(outfit);
    }

    public Outfit find(Object id) {
        return outfitFacade.find(id);
    }

    public List<Outfit> findAll() {
        return outfitFacade.findAll();
    }

    public List<Outfit> findRange(int[] range) {
        return outfitFacade.findRange(range);
    }

    public int count() {
        return outfitFacade.count();
    }

    public List findByID(String mail) {
        return outfitFacade.findByID(mail);
    }
 

}
